﻿// 选择英雄

using UnityEngine;
using UnityEngine.UI;
using System;
using System.Collections;
using UIKit;


namespace DemoProject
{
    public class SelectHeroForms : BaseUIForms
    {
        public Text TxtEnterGame;

        void Awake()
        {
            //本窗体状态
            //CurrentUIType.UIForms_Type = SysDefine.UIFormsType.Normal;
            CurrentUIType.UIForms_ShowMode = UIFormsShowMode.Normal;

            //事件注册
            AddClickEventListener("BtnOK", EnterMainUIForm);
            AddClickEventListener("ImgReturn",p=>
            {
                CloseUIForms<SelectHeroForms>();  
            });
        }//Awake_end

        void Start()
        {
            if (TxtEnterGame)
            {
                TxtEnterGame.text = ShowText("EnterGame");
            }
        }//Start_end

        #region  窗体生命周期
        public override void OnOpen()
        {
            base.OnOpen();
            Log.Write(GetType() + "/OnOpen()");
        }

        public override void OnReOpen()
        {
            base.OnReOpen();
            Log.Write(GetType() + "/OnReOpen()");
        }

        public override void OnFreeze()
        {
            base.OnFreeze();
            Log.Write(GetType() + "/OnFreeze()");
        }

        public override void OnClose()
        {
            base.OnClose();
            Log.Write(GetType() + "/OnClose()");
        }
        #endregion

        //进入游戏主窗体
        private void EnterMainUIForm(GameObject go)
        {
            ShowUIForms(UIFormsID.MainForms.ToString());
            ShowUIForms(UIFormsID.HeroInfo.ToString());
        }
    }//Class_end
}